<!DOCTYPE html>
<head>
  <meta charset="UTF-8">
  <title>{% if page.group == "home" %}{{ site.title }} - {{ page.tagline }}{% else %}{{ page.title }} - {{ site.title }}{% endif %}</title>

{% capture tmpcache %}
{% capture nl0 %}
{% endcapture %}
{% endcapture %}{% assign tmpcache = nil %}

  {% capture keywords %}{% assign keywords = page.keywords %}{% assign tags = page.tags | join: "," %}{{ page.categories | join: "," | append: "," | append:"," | append: tags | append:',' | append: keywords | replace:", ","," | replace:"  "," " | replace:"  "," " | append:',' | append:page.album | strip_html | xml_escape | downcase | split:"," | sort | uniq | join:"," }}{% endcapture %}

  {% assign keywords = keywords | prepend:"pLACeHoldER," | replace: ",,,","," | replace: ",,","," | remove:'pLACeHoldER,' %}

  {% if keywords != empty %}
    <meta name="keywords" content="{{ keywords }}">

    {% capture description %}{% if page.description %}{{ page.description }}{% else %}{{ page.content | strip_html | remove:'>' | remove: '<' | replace: nl0, ' ' | replace: '    ', ' ' | replace: '   ', ' ' | replace: '  ', ' ' |  strip | truncate:200 | xml_escape }}{% endif %}{% endcapture %}
    {% unless description contains '{% ' %}
      <meta name="description" content="{{ description }}"/>
    {% endunless %}

  {% endif %}

  <meta name="author" content="{% if page.author %}{{ page.author }}{% else %}{{ site.title }}{% endif%}">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <!-- Favicon -->
  <link rel="shortcut icon" href="{{ BASE_PATH }}/favicon.ico">

  <!-- Feed -->
  <link rel="alternate" type="application/rss+xml" title="RSS Feed" href="{{ site.JB.rss_path }}">
  <link rel="alternate" type="application/atom+xml" title="Atom Feed" href="{{ site.JB.atom_path }}">

  <!-- Styles -->
  {% if site.data.compress.css_js %}
    {% assign css_js_compress_tag = site.data.compress.css_js_tag %}
  {% else %}
    {% assign css_js_compress_tag = "" %}
  {% endif %}

  <link rel="stylesheet" href="{{ ASSET_PATH }}/css/style{{ css_js_compress_tag }}.css">
  <link rel="stylesheet" href="{{ ASSET_PATH }}/css/fontello{{ css_js_compress_tag }}.css">
  <link rel="stylesheet" href="{{ ASSET_PATH }}/css/tooltip{{ css_js_compress_tag }}.css" media="screen">

  {% if page.toc != false or page.ctg == true %}
    <link rel="stylesheet" href="{{ ASSET_PATH }}/css/toc{{ css_js_compress_tag }}.css" type="text/css" media="screen">
    <link rel="stylesheet" href="{{ ASSET_PATH }}/tocmd/css/toc{{ css_js_compress_tag }}.css" type="text/css" media="all">
  {% endif %}
  {% if page.group != "home" %}
    <link rel="stylesheet" href="{{ ASSET_PATH }}/code-prettify/{{ site.JB.code_prettify.theme }}{{ css_js_compress_tag }}.css" type="text/css" media="all">
    <link rel="stylesheet" href="{{ ASSET_PATH }}/css/svg{{ css_js_compress_tag }}.css">
  {% endif %}

  {% if page.plugin %}<link rel="stylesheet" href="{{ ASSET_PATH }}/css/{{ page.plugin }}{{ css_js_compress_tag }}.css" type="text/css" media="all">{% endif %}

  <!-- Scripts -->
  <script type="text/javascript" src="{{ ASSET_PATH }}/js/jquery-1.10.1{{ css_js_compress_tag }}.js"></script>
  <script type="text/javascript" src="{{ ASSET_PATH }}/js/iframeResizer{{ css_js_compress_tag }}.js"></script>
  <script type="text/javascript" src="{{ ASSET_PATH }}/qrcode/jquery.qrcode{{ css_js_compress_tag }}.js"></script>
  <script type="text/javascript" src="{{ ASSET_PATH }}/js/core{{ css_js_compress_tag }}.js"></script>
  <script>
    function resize_iframe() {
	iFrameResize({
		log: false,
		autoResize: true,
		interval: -1,
		minHeight: 300,
		heightCalculationMethod: "lowestElement",
	});
    }

    $(document).ready(function () {
      resize_iframe();
    });
  </script>

</head>

<body>

  <div id="up"></div>
  {% include widgets/site_info %}
  <div id="top-wrap">
    <section id="top-wrap-inner">
    <header id="top">
      <!-- Home Link -->
      <a id="logo" href="{{ HOME_PATH }}" title="回到首页">T</a>
      <div id="search-box">
        {% include widgets/search_box %}
      </div>
      <!-- Navigation Bar -->
      <div id="phone-navbar">
          {% include widgets/phone_navbar_list %}
      </div>
      <nav id="navbar">
          <div id="menu-icon">
               <a title="导航菜单" onclick="common_click('#menu-container', '#menu-icon a i', 'th', 'th-list')"><i class="icon-large icon-fixed-width icon-th-list"></i></a>
          </div>
          <div id="menu-container">
           {% include widgets/navbar_list %}
          </div>
      </nav>
    </header>
   </section>
  </div>

  <div id="wrap">
    <section id="main">
      {% include widgets/float_box %}

      <!-- Sidebar -->
      <aside id="sidebar">
        {% include widgets/fixed_container %}
      </aside>
      <!-- Main Content -->
      <div id="main-inner">
          <div align="center">
            {% include widgets/home_ads %}
          </div>
          <div style="height: 15px; width: 100%"></div>

        <div id="loader"><img src="{{ ASSET_PATH }}/img/loading.gif" alt="请稍侯"></div>
        <div id="main-content">
          {{ content }}
        </div>
      </div>

    </section>

    <footer id="bottom">
    {% include widgets/footer %}
    </footer>
  </div>
  <div id="down"></div>


  {% if page.toc != false %}
    <script src="{{ ASSET_PATH }}/js/toc{{ css_js_compress_tag }}.js"></script>
    <script src="{{ ASSET_PATH }}/tocmd/js/jquery.toc{{ css_js_compress_tag }}.js"></script>
  {% endif %}

  {% if page.group != "home" %}
  <script type="text/javascript" src="{{ ASSET_PATH }}/js/scrollspy{{ css_js_compress_tag }}.js"></script>

  <script src="{{ ASSET_PATH }}/code-prettify/prettify{{ css_js_compress_tag }}.js"></script>
  {% include widgets/code-prettify %}
  {% endif %}

  {% if page.plugin %}<script src="{{ ASSET_PATH }}/js/{{ page.plugin }}{{ css_js_compress_tag }}.js"></script>{% endif %}

  {% include widgets/mathjax %}

  {% include JB/analytics %}

</body>
</html>
